﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SmallTune.Models
{
    public class Artist
    {
        public virtual int id { get; set; }
        public virtual string name { get; set; }
        public virtual IList<Song> listOfSongs { get; set; }
        public virtual IList<Album> listOfAlbums { get; set; }
        public virtual DateTime lastChanged { get; set; }
        public virtual DateTime created { get; set; }

        public Artist()
        {
            listOfAlbums = new List<Album>();
            listOfSongs = new List<Song>();
            
        }

        public override int GetHashCode()
        {
            return this.name.GetHashCode();
        }

        public virtual void AddAlbum(Album album)
        {
            album.listOfArtists.Add(this);
            this.listOfAlbums.Add(album);
        }
    }
}
